<template>
  <div class="swiper-box">
    <mt-swipe class="my-swipe" :auto="4000">
      <!-- 在组件中，使用v-for循环的话，一定要使用 key -->
      <mt-swipe-item v-for="item in props" :key="item.id">
        <img v-if="item.img" class="img" :src="item.img" alt>
        <img v-else class="src" :src="item.src" alt>
      </mt-swipe-item>
    </mt-swipe>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: ["props"]
};
</script>

<style lang="scss" scoped>
.swiper-box {
  .my-swipe {
    height: 30vh;
    text-align: center;
    .img {
      width: 100%;
      height: 100%;
    }
    .src {
      height: 100%;
    }
  }
}
</style>